<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改房屋信息')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-house-edit" th:object="${haHouseInfo}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">标题：</label>
            <div class="col-sm-8">
                <input name="title" th:field="*{title}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">价格：</label>
            <div class="col-sm-8">
                <input name="price" th:field="*{price}" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">租赁方式：</label>
            <div class="col-sm-8">
                <input name="style" th:field="*{style}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所在小区：</label>
            <div class="col-sm-8">
                <select class="form-control m-b" name="community">
                    <option th:selected="*{community == '小区A'}" value="小区A">小区A</option>
                    <option th:selected="*{community == '小区B'}" value="小区B">小区B</option>
                    <option th:selected="*{community == '小区C'}" value="小区C">小区C</option>
                </select>
                <!--                    <input name="community" th:field="*{community}" class="form-control" type="text">-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属区域：</label>
            <div class="col-sm-8">
                <input name="area" th:field="*{area}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">详细地址：</label>
            <div class="col-sm-8">
                <input name="address" th:field="*{address}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "house/house";
    $("#form-house-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-house-edit').serialize());
        }
    }
</script>
</body>
</html>